package com.acidsweet.zerolrucache.util;

import android.util.Log;

/**
 * Created by jin on 16/8/3.
 */
public class Logger{
    public static final int DEBUG_MODE=0;
    public static final int DEBUG_RELEASE=1;
    private static int MODE=DEBUG_MODE;//0:Debug 1:Release

    public static int getMODE() {
        return MODE;
    }

    public static void setMODE(int MODE) {
        Logger.MODE = MODE;
    }
    public static void v(String tag, String msg) {
        if(DEBUG_MODE==MODE)
            Log.v(tag,msg);
    }

    public static void v(String tag, String msg, Throwable tr) {
        if(DEBUG_MODE==MODE)
            Log.v(tag,msg,tr);
    }

    public static void d(String tag, String msg) {
        if(DEBUG_MODE==MODE)
            Log.d(tag,msg);
    }

    public static void d(String tag, String msg, Throwable tr) {
        if(DEBUG_MODE==MODE)
            Log.d(tag,msg,tr);
    }

    public static void i(String tag, String msg) {
        if(DEBUG_MODE==MODE)
            Log.i(tag,msg);
    }

    public static void i(String tag, String msg, Throwable tr) {
        if(DEBUG_MODE==MODE)
            Log.i(tag,msg,tr);
    }

    public static void w(String tag, String msg) {
        if(DEBUG_MODE==MODE)
            Log.w(tag,msg);
    }

    public static void w(String tag, String msg, Throwable tr) {
        if(DEBUG_MODE==MODE)
            Log.w(tag,msg,tr);
    }

    public static void w(String tag, Throwable tr) {
        if(DEBUG_MODE==MODE)
            Log.w(tag,tr);
    }

    public static void e(String tag, String msg) {
        if(DEBUG_MODE==MODE)
            Log.e(tag,msg);
    }

    public static void e(String tag, String msg, Throwable tr) {
        if(DEBUG_MODE==MODE)
            Log.e(tag,msg,tr);
    }

    public static void wtf(String tag, String msg) {
        if(DEBUG_MODE==MODE)
            Log.wtf(tag,msg);
    }

    public static void wtf(String tag, Throwable tr) {
        if(DEBUG_MODE==MODE)
            Log.wtf(tag,tr);
    }

    public static void wtf(String tag, String msg, Throwable tr) {
        if(DEBUG_MODE==MODE)
            Log.wtf(tag,msg,tr);
    }

    public static String getStackTraceString(Throwable tr) {
        if(DEBUG_MODE==MODE)
            return Log.getStackTraceString(tr);
        return null;
    }

    public static void println(int priority, String tag, String msg) {
        if(DEBUG_MODE==MODE)
            Log.println(priority,tag,msg);
    }

}
